import i18n from '@/locales'

export function generateTitle(title: string | undefined) {
  const hasKey = i18n.global.t('route.' + title)
  const translatedTitle = i18n.global.t('route.' + title)

  if (hasKey) {
    return translatedTitle
  }

  return title
}
